package com.atguigu.petstore.sys.controller;

import com.atguigu.petstore.common.result.Result;
import com.atguigu.petstore.sys.entity.SysUser;
import com.atguigu.petstore.sys.service.SysUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin(origins = "*")
@RequestMapping("/api/sys")
@RestController
@Tag(name = "系统用户")
public class SysUserController {
    @Autowired
 SysUserService userService;
    @GetMapping("/user")
    @Operation(summary = "查询所有用户")
    public Result getAllUser(){
        List<SysUser> list = userService.list();
        return Result.ok(list);
    }
}
